use chrono::{DateTime, Local};

pub mod url;
pub mod user;
pub mod user_url;

pub struct Pagination {
    pub page: u32,
    pub page_size: u32,
}

impl std::default::Default for Pagination {
    fn default() -> Self {
        Self {
            page: 0,
            page_size: 30,
        }
    }
}

impl Pagination {
    pub fn offset(&self) -> i64 {
        (self.page * self.page_size) as i64
    }
    pub fn page_size(&self) -> i64 {
        self.page_size as i64
    }
}

pub struct DateTimeRange {
    pub start: DateTime<Local>,
    pub end: DateTime<Local>,
}
